package com.lottery.material.service.portal.portaluser.impl;

import com.lottery.material.dao.base.BaseDao;
import com.lottery.material.dao.portal.portaluser.PortalUserInfoDao;
import com.lottery.material.dto.portal.PortalUserInfoDto;
import com.lottery.material.entity.portaluser.PortalUserInfo;
import com.lottery.material.service.base.impl.BaseServiceImpl;
import com.lottery.material.service.portal.portaluser.PortalUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;


@Service
public class PortalUserInfoServiceImpl extends BaseServiceImpl<PortalUserInfo, Integer> implements PortalUserInfoService {

    @Autowired
    PortalUserInfoDao portalUserInfoDao;

    @Override
    public BaseDao<PortalUserInfo, Integer> getBaseDao() {
        return portalUserInfoDao;
    }

    @Override
    public Optional<PortalUserInfo> findByLoginPhoneNumberAndUserStatusNot(String phoneNumber,Integer userStatus) {
        return portalUserInfoDao.findByLoginPhoneNumberAndUserStatusNot(phoneNumber,userStatus);
    }

    @Override
    public Optional<PortalUserInfo> findByUserId(String userId) {
        return portalUserInfoDao.findByUserId(userId);
    }

    @Override
    public PortalUserInfoDto findMyPortalUserInfoDtoByUserId(String userId) {
        return portalUserInfoDao.findMyPortalUserInfoDtoByUserId(userId);
    }

//    @Override
//    public PortalUserInfoDto findPortalUserInfoDtoByUserId(String userId) {
//        return portalUserInfoDao.findPortalUserInfoDtoByUserId(userId);
//    }


}
